package com.mpastruct.test.convertor;

import com.mpastruct.test.dto.CarDto;
import com.mpastruct.test.entities.Car;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @author liuziyang
 * @create 2020/8/15 17:20
 * @description
 */
@Mapper
public interface CarMapper {

    CarMapper INSTANCE = Mappers.getMapper(CarMapper.class);

    /**
     * Car to car dto car dto.
     *
     * @param car the car
     * @return the car dto
     */
    @Mapping(source = "numberOfSeats", target = "seatCount")
    CarDto carToCarDto(Car car);
}
